package main

import (
	"github.com/sirupsen/logrus"
	"github.com/urfave/cli/v2"
	"os"
	"ycontainer/client"
)

func main() {

	app := cli.NewApp()
	app.Name = "yContainer"
	app.Usage = "yContainer"

	app.Commands = cli.Commands{
		client.Init,
		client.Run,
		client.Remove,
		client.Commit,
		client.Ps,
		client.Logs,
		client.Network,
	}

	app.Before = func(context *cli.Context) error {
		logrus.SetReportCaller(true)
		//logrus.SetFormatter(&logrus.JSONFormatter{})
		logrus.SetOutput(os.Stdout)
		return nil
	}

	if err := app.Run(os.Args); err != nil {
		logrus.Fatal(err)
	}

}
